#include "sr.h"
#include "edbd_extcall.h"

EDBFUNC_API sr_t *
test_xecreate(sr_t *sr_args)
{
	sr_t	*sr_xe;
	sr_t	*sr_tests, *sr_res;
	srt_t	srt;

	if (!sr_search_srt("test", &srt))
		return NULL;
	sr_xe = xe_create(srt);
	sr_setc_str(sr_xe, "str", "success");
	sr_setc_int(sr_xe, "int", 1234);
	sr_setc_bool(sr_xe, "bool", ECM_FALSE);

	sr_tests = sr_getn(NULL, "/tests");

	if (edbd_xeappend(sr_tests, sr_xe))
		sr_res = sr_create_bool(ST_BOOL, ECM_TRUE);
	else
		sr_res = sr_create_bool(ST_BOOL, ECM_FALSE);
	sr_free(sr_xe);
	return sr_res;
}
